package com.smart.reflect;

/**
 * @author chenxingyu
 * @date 2019/8/20 20:01
 */
public class ClassLoaderTest {
    public static void main(String[] args) {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        System.out.println("current loader:"+loader);
        System.out.println("parent loader:"+loader.getParent());
        System.out.println("grandparent loader:"+loader.getParent().getParent());
//        current loader:sun.misc.Launcher$AppClassLoader@18b4aac2
//        parent loader:sun.misc.Launcher$ExtClassLoader@3f99bd52
//        grandparent loader:null  根装载器非java语言写的，所以无法获得
    }
}
